// 封装通用的接口调用方法
const request = (path, param, method, header) => {
  let url = "https://api-hmugo-web.itheima.net/api/public/v1/" + path;
  return new Promise(function (resolve, reject) {
    // 这里处理异步操作（接口调用）
    mpvue.request({
      url: url,
      data: param,
      method: method ? method : "get",
      header: header,
      success: (res) => {
        //获取接口调用的结果
        resolve(res);
      },
    });
  });
};
export default request;
